package fr.isima.myanttest;

import static org.junit.Assert.fail;

import java.io.File;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

import org.junit.Before;
import org.junit.Test;

import fr.isima.myant.Project;

public class DeleteTest {
	Project p;
	
	@Before
	public void beforeExecute() {
		try{
			p = new Project("testDelete.txt");
			File f = new File("testDelete.bin");
			f.createNewFile();
		} catch(Exception e) {
			fail(e.getMessage());
		}
	}
	
	@Test
	public void testExecute() {
		p.execute("testdelete");
		
		Path path = Paths.get("testDelete.bin");
		if (Files.exists(path)) {
			fail("file not deleted.");
		}		
	}
}
